 
  function startCourse()


{

// check to see if cookies is enabled, otherwise, this won't work



if( typeof sessionStorage === "undefined" || sessionStorage.disabled )


{


alert( "You must enable cookies for this course to work properly." );



}



else



{



// if it is enabled, checked to see if this course was started



// if it was not able to retrieve, the key "course_started", then



// then this is the first time we are running the course



        if( !sessionStorage.getItem( "course_started" ) )



        {



        // clear the session storage



            sessionStorage.clear();



            // set the "key" by giving it a value.  all values are strings!



    sessionStorage.setItem( "course_started", "1" );



    sessionStorage.setItem( "uae", "0" );



    sessionStorage.setItem( "niger", "0" );



    sessionStorage.setItem( "sudan", "0" );



    sessionStorage.setItem( "sweden", "0" );



        }



}



}



function visitUae()



{



sessionStorage.setItem( "uae", "visited" );







showQuiz();



 



}



function visitNiger()



{



sessionStorage.setItem( "niger", "visited" );







showQuiz();



 



}





function visitSudan()



{



sessionStorage.setItem( "sudan", "visited" );



showQuiz();



}







function visitSweden()



{



sessionStorage.setItem( "sweden", "visited" );


showQuiz();



}



//this function will check to see if every page was visited



//if so, show the Test link


function showQuiz()



{

var UaeVisited = sessionStorage.getItem( "Uae" );

var NigerVisited = sessionStorage.getItem( "Niger" );
 
var SudanVisited = sessionStorage.getItem( "Sudan" );

var SwedenVisited = sessionStorage.getItem( "Sweden" );



if( UAEVisited == "visited" && NigerVisited == "visited" && SudanVisited == "visited" && SwedenVisited == "visited" )

{


document.getElementById( "quiz-link" ).style.display = "inline";

}


function submitQuiz()




{
var numberCorrect = 0;



var q1 = document.forms.quiz1.question1;

if( q1[ 0 ].checked == true ) 

{

 numberCorrect = numberCorrect + 1;



 }

 

   var q2 = document.forms.quiz1.question2;

    if( q2[ 1 ].checked == true )

    {

 numberCorrect = numberCorrect + 1;

 }

    

    var q3 = document.forms.quiz1.question3;

    if( q3[ 2 ].checked == true )

    {

 numberCorrect = numberCorrect + 1;

 }

    

    

    var q4 = document.forms.quiz1.question4;

    if( q4[ 1 ].checked == true )

    {

 numberCorrect = numberCorrect + 1;

 }
 
    var q5 = document.forms.quiz1.question5;

    if( q5[ 2 ].checked == true )

    {

 numberCorrect = numberCorrect + 1;

 }
    var q6 = document.forms.quiz1.question6;

    if( q6[ 0 ].checked == true )

    {

 numberCorrect = numberCorrect + 1;

 }
    var percentage=numberCorrect/6 * 100; 

	alert("Your percentage is" + percentage+"%");

}